package com.example.service;

import com.example.entity.SystemData;
import com.example.mapper.SystemDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 作者：风中叶
 * 功能：系统数据业务处理
 */

@Service
public class SystemDataService {

    @Autowired
    private SystemDataMapper systemDataMapper;

    public List<SystemData> getSystemData() {
        return systemDataMapper.getSystemData();
    }

    // 获取前一天统计数据
    public SystemData getLastData() {
        return systemDataMapper.getLastData();
    }

    public void addData(SystemData newSystemData) {
        systemDataMapper.insert(newSystemData);
    }
}
